﻿#include "Finder/NavHelper.h"
#include <string>
#include <iostream>
#include <fstream>
#include<chrono>
#include<thread>

int main(int argn, char* argc[]) {
	if (argn != 2) {
		std::cout << "usage: testbenchmark <meshfile>\n";
		return 0;
	}

	auto mesh = NavHelper::GetNavMeshTO(argc[1]);
	if (mesh == nullptr)
	{
		std::cerr << "NavHelper::GetNavMeshTO() fail " << argc[1] << std::endl;
		return 0;
	}

	float beginPos[3] = { 2.69, -2.21, 8.13 };
	float endPos[3] = { 2.85, -0.69, 6.00 };
	int count;
	float* pos = nullptr;
	for (;;)
	{
		pos = NavHelper::FindPathTO(mesh, beginPos[0], beginPos[1], beginPos[2], endPos[0], endPos[1], endPos[2], &count);
		std::this_thread::sleep_for(std::chrono::milliseconds(10));
	}

	return 0;
}
